******
*Wright, Thorin M. 2020. "Revisionist Conflict and State Repression" International Area Studies Review.
*Replication Script
******

clear 
clear matrix 
use "WrightIASR_replication.dta"


tsset ccode year

*Table 1

oprobit ciri terrrev regrev polrev  l.lpop l.lgdp civwar anymid l.i.ciri if l.dem==1  &  year<2011, cluster(ccode)

oprobit polpris terrrev regrev polrev l.lpop l.lgdp civwar anymid l.i.polpris if  year<2011 & l.dem==1 & l.ciri!=. & ciri!=., cluster(ccode)

oprobit tort terrrev regrev polrev l.lpop l.lgdp civwar anymid l.i.tort if  year<2011 & l.dem==1 & l.ciri!=. & ciri!=., cluster(ccode)

oprobit kill terrrev regrev polrev l.lpop l.lgdp  civwar anymid l.i.kill if  year<2011 & l.dem==1 & l.ciri!=. & ciri!=., cluster(ccode)

oprobit disap  terrrev regrev polrev l.lpop l.lgdp  civwar anymid l.i.disap if  year<2011 & l.dem==1 & l.ciri!=. & ciri!=. & year>1981, cluster(ccode)


*Table 2

oprobit ciri terrrev regrev polrev  l.lpop l.lgdp civwar anymid l.i.ciri if l.dem==0  &  year<2011, cluster(ccode)

oprobit polpris terrrev regrev polrev l.lpop l.lgdp civwar anymid l.i.polpris if  year<2011 & l.dem==0 & l.ciri!=. & ciri!=., cluster(ccode)

oprobit tort terrrev regrev polrev l.lpop l.lgdp civwar anymid l.i.tort if  year<2011 & l.dem==0 & l.ciri!=. & ciri!=., cluster(ccode)

oprobit kill terrrev regrev polrev l.lpop l.lgdp  civwar anymid l.i.kill if  year<2011 & l.dem==0 & l.ciri!=. & ciri!=., cluster(ccode)

oprobit disap  terrrev regrev polrev l.lpop l.lgdp  civwar anymid l.i.disap if  year<2011 & l.dem==0 & l.ciri!=. & ciri!=. & year>1981, cluster(ccode)


*Table 3
*are more repressive dems just getting into conflict?

oprobit ciri terrrev regrev polrev  l.lpop l.lgdp civwar anymid l.i.ciri l.c.ciri#c.terrrev if l.dem==1  &  year<2011, cluster(ccode)

oprobit ciri terrrev regrev polrev  l.lpop l.lgdp civwar anymid l.i.ciri l.c.ciri#c.polrev if l.dem==0  &  year<2011, cluster(ccode)


*robustcheck with pooled sample

oprobit ciri terrrev regrev polrev c.l.dem#c.terrrev c.l.dem#c.regrev c.l.dem#c.polrev l.dem l.lpop l.lgdp civwar anymid l.i.ciri if year<2011 & l.ciri!=. & ciri!=., cl(ccode)

oprobit polpris terrrev regrev polrev c.l.dem#c.terrrev c.l.dem#c.regrev c.l.dem#c.polrev l.dem l.lpop l.lgdp civwar anymid l.i.polpris if year<2011 & l.ciri!=. & ciri!=., cl(ccode)

oprobit tort terrrev regrev polrev c.l.dem#c.terrrev c.l.dem#c.regrev c.l.dem#c.polrev l.dem l.lpop l.lgdp civwar anymid l.i.tort if year<2011 & l.ciri!=. & ciri!=., cl(ccode)

oprobit kill terrrev regrev polrev c.l.dem#c.terrrev c.l.dem#c.regrev c.l.dem#c.polrev l.dem l.lpop l.lgdp civwar anymid l.i.kill if year<2011 & l.ciri!=. & ciri!=., cl(ccode)

oprobit disap terrrev regrev polrev c.l.dem#c.terrrev c.l.dem#c.regrev c.l.dem#c.polrev l.dem l.lpop l.lgdp civwar anymid l.i.disap if year<2011 & l.ciri!=. & ciri!=., cl(ccode)



*big interaction model w/civconflict instead of civwar

oprobit ciri terrrev regrev polrev c.l.dem#c.terrrev c.l.dem#c.regrev c.l.dem#c.polrev l.dem l.lpop l.lgdp civconflict anymid l.i.ciri if year<2011 & l.ciri!=., cl(ccode)

oprobit polpris terrrev regrev polrev c.l.dem#c.terrrev c.l.dem#c.regrev c.l.dem#c.polrev l.dem l.lpop l.lgdp civconflict anymid l.i.polpris if year<2011 & l.ciri!=. & ciri!=., cl(ccode)

oprobit tort terrrev regrev polrev c.l.dem#c.terrrev c.l.dem#c.regrev c.l.dem#c.polrev l.dem l.lpop l.lgdp civconflict anymid l.i.tort if year<2011 & l.ciri!=. & ciri!=., cl(ccode)

oprobit kill terrrev regrev polrev c.l.dem#c.terrrev c.l.dem#c.regrev c.l.dem#c.polrev l.dem l.lpop l.lgdp civconflict anymid l.i.kill if year<2011 & l.ciri!=. & ciri!=., cl(ccode)

oprobit disap terrrev regrev polrev c.l.dem#c.terrrev c.l.dem#c.regrev c.l.dem#c.polrev l.dem l.lpop l.lgdp civconflict anymid l.i.disap if year<2011 & l.ciri!=. & ciri!=., cl(ccode)



**robustcheck with vdem
*libdem
oprobit ciri terrrev regrev polrev c.l.v2x_libdem#c.terrrev c.l.v2x_libdem#c.regrev c.l.v2x_libdem#c.polrev l.v2x_libdem l.lpop l.lgdp civwar anymid l.i.ciri if year<2011 & l.ciri!=. & ciri!=., cl(ccode)

oprobit polpris terrrev regrev polrev c.l.v2x_libdem#c.terrrev c.l.v2x_libdem#c.regrev c.l.v2x_libdem#c.polrev l.v2x_libdem l.lpop l.lgdp civwar anymid l.i.polpris if year<2011 & l.ciri!=. & ciri!=., cl(ccode)

oprobit tort terrrev regrev polrev c.l.v2x_libdem#c.terrrev c.l.v2x_libdem#c.regrev c.l.v2x_libdem#c.polrev l.v2x_libdem l.lpop l.lgdp civwar anymid l.i.tort if year<2011 & l.ciri!=. & ciri!=., cl(ccode)

oprobit kill terrrev regrev polrev c.l.v2x_libdem#c.terrrev c.l.v2x_libdem#c.regrev c.l.v2x_libdem#c.polrev l.v2x_libdem l.lpop l.lgdp civwar anymid l.i.kill if year<2011 & l.ciri!=. & ciri!=., cl(ccode)

oprobit disap terrrev regrev polrev c.l.v2x_libdem#c.terrrev c.l.v2x_libdem#c.regrev c.l.v2x_libdem#c.polrev l.v2x_libdem l.lpop l.lgdp civwar anymid l.i.disap if year<2011 & l.ciri!=. & ciri!=., cl(ccode)

*electoral dem
oprobit ciri terrrev regrev polrev c.l.v2x_polyarchy#c.terrrev c.l.v2x_polyarchy#c.regrev c.l.v2x_polyarchy#c.polrev l.v2x_polyarchy l.lpop l.lgdp civwar anymid l.i.ciri  if year<2011 & l.ciri!=. & ciri!=., cl(ccode)

oprobit polpris terrrev regrev polrev c.l.v2x_polyarchy#c.terrrev c.l.v2x_polyarchy#c.regrev c.l.v2x_polyarchy#c.polrev l.v2x_polyarchy l.lpop l.lgdp civwar anymid l.i.polpris if year<2011 & l.ciri!=. & ciri!=., cl(ccode)

oprobit tort terrrev regrev polrev c.l.v2x_polyarchy#c.terrrev c.l.v2x_polyarchy#c.regrev c.l.v2x_polyarchy#c.polrev l.v2x_polyarchy l.lpop l.lgdp civwar anymid l.i.tort if year<2011 & l.ciri!=. & ciri!=., cl(ccode)

oprobit kill terrrev regrev polrev c.l.v2x_polyarchy#c.terrrev c.l.v2x_polyarchy#c.regrev c.l.v2x_polyarchy#c.polrev l.v2x_polyarchy l.lpop l.lgdp civwar anymid l.i.kill if year<2011 & l.ciri!=. & ciri!=., cl(ccode)

oprobit disap terrrev regrev polrev c.l.v2x_polyarchy#c.terrrev c.l.v2x_polyarchy#c.regrev c.l.v2x_polyarchy#c.polrev l.v2x_polyarchy l.lpop l.lgdp civwar anymid l.i.disap if year<2011 & l.ciri!=. & ciri!=., cl(ccode)



*Predicted Probabilities for Figures 1 and 2 (Note: Need to download Clarify)


*Pred Probs for Democracies (Figure 1)

estsimp oprobit ciri  ciri1 ciri2 ciri3 ciri4 ciri5 ciri6 ciri7 ciri8 terrrev regrev polrev lpop_lag lgdppc_lag civwar  anymid if  dem_lag==1 & year<2011, cluster(ccode)

setx  ciri1 1 ciri2 0 ciri3 0 ciri4 0 ciri5 0 ciri6 0 ciri7 0 ciri8 0 terrrev 0 regrev 0 polrev 0 lpop_lag (mean) lgdppc_lag (mean) civwar 0 anymid 0
simqi, pr level(90)
setx  ciri1 1 ciri2 0 ciri3 0 ciri4 0 ciri5 0 ciri6 0 ciri7 0 ciri8 0 terrrev 1 regrev 0 polrev 0 lpop_lag (mean) lgdppc_lag (mean) civwar 0 anymid 1
simqi, pr level(90)

simqi, fd(prval(2))  changex(terrrev 0 1 anymid 0 1) level(90)


drop b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16 b17 b18 b19 b20 b21 b22 b23 


estsimp oprobit polpris polpris1 polpris2 terrrev regrev polrev lpop_lag lgdppc_lag civwar anymid if  year<2011 & dem_lag==1 & l.ciri!=. & ciri!=., cluster(ccode)

setx polpris1 0 polpris1 0 terrrev 0 regrev 0 polrev 0  lpop_lag (mean) lgdppc_lag (mean) civwar 0 anymid 0
simqi, pr level(90)
setx polpris1 0 polpris1 0 terrrev 1 regrev 0 polrev 0 lpop_lag (mean) lgdppc_lag (mean) civwar 0 anymid 1
simqi, pr level(90)

simqi, fd(prval(1))  changex(terrrev 0 1 anymid 0 1) level(90)

drop b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 

estsimp oprobit tort tort1 tort2 terrrev regrev polrev lpop_lag lgdppc_lag civwar anymid if  year<2011 & dem_lag==1 & l.ciri!=. & ciri!=., cluster(ccode)

setx tort2 0 tort1 1 terrrev 0 regrev 0 polrev 0  lpop_lag (mean) lgdppc_lag (mean) civwar 0 anymid 0
simqi, pr level(90)
setx tort2 0 tort1 1 terrrev 1 regrev 0 polrev 0  lpop_lag (mean) lgdppc_lag (mean) civwar 0 anymid 1
simqi, pr level(90)

simqi, fd(prval(2))  changex(terrrev 0 1 anymid 0 1) level(90)

drop b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11  


*Pred Probs for Autocracies (Figure 2)

estsimp oprobit ciri ciri1 ciri2 ciri3 ciri4 ciri5 ciri6 ciri7 ciri8 terrrev regrev polrev  lpop_lag lgdppc_lag civwar anymid if dem_lag==0 & year<2011 & l.ciri!=. & ciri!=., cluster(ccode)



*base
setx ciri1 0 ciri2 0 ciri3 0 ciri4 1 ciri5 0 ciri6 0 ciri7 0 ciri8 0 terrrev 0 regrev 0 polrev 0 lpop_lag (mean) lgdppc_lag (mean) civwar 0 anymid 0
simqi, pr level(90)
*pol rev
setx ciri1 0 ciri2 0 ciri3 0 ciri4 1 ciri5 0 ciri6 0 ciri7 0 ciri8 0 terrrev 0 regrev 0 polrev 1  lpop_lag (mean) lgdppc_lag (mean) civwar 0 anymid 1
simqi, pr level(90)
*pol sq
*setx ciri1 0 ciri2 0 ciri3 0 ciri4 1 ciri5 0 ciri6 0 ciri7 0 ciri8 0 terrrev 0 regrev 0 polrev 0  lpop_lag (mean) lgdppc_lag (mean) civwar 0 anymid 1
*simqi, pr level(90)


*first dif
*PolRev
simqi, fd(prval(5))  changex(polrev 0 1 anymid 0 1) level(90)



drop b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16 b17 b18 b19 b20 b21 b22 b23 

*torture

estsimp oprobit tort tort1 tort2 terrrev regrev polrev lpop_lag lgdppc_lag civwar anymid if  year<2011 & dem_lag==0 & l.ciri!=. & ciri!=., cluster(ccode)

setx tort2 0 tort1 1 terrrev 0 regrev 0 polrev 0  lpop_lag (mean) lgdppc_lag (mean) civwar 0 anymid 0
simqi, pr level(90)
setx tort2 0 tort1 1 terrrev 0 regrev 0 polrev 1  lpop_lag (mean) lgdppc_lag (mean) civwar 0 anymid 1
simqi, pr level(90)
*polsq
*setx tort2 0 tort1 1 terrrev 0 regrev 0 polrev 0 terrsq 0 regsq 0 polsq 1 lpop_lag (mean) lgdppc_lag (mean) civwar 0 anymid 1
*simqi, pr level(90)

*First Differences

simqi, fd(prval(2))  changex(polrev 0 1 anymid 0 1) level(90)



*killing

drop b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 

estsimp oprobit kill kill1 kill2 terrrev regrev polrev  lpop_lag lgdppc_lag civwar anymid if  year<2011 & dem_lag==0 & l.ciri!=. & ciri!=., cluster(ccode)

setx kill1 1 kill2 0 terrrev 0 regrev 0 polrev 0  lpop_lag (mean) lgdppc_lag (mean) civwar 0 anymid 0
simqi, pr level(90)
setx kill1 1 kill2 0 terrrev 0 regrev 0 polrev 1  lpop_lag (mean) lgdppc_lag (mean) civwar 0 anymid 1
simqi, pr level(90)




simqi, fd(prval(2))  changex(polrev 0 1 anymid 0 1) level(90)



drop b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 

*disap

estsimp oprobit disap disap1 disap2 terrrev regrev polrev lpop_lag lgdppc_lag civwar anymid if  year<2011 & dem_lag==0 & l.ciri!=. & ciri!=., cluster(ccode)

setx disap1 0 disap2 0 terrrev 0 regrev 0 polrev 0  lpop_lag (mean) lgdppc_lag (mean) civwar 0 anymid 0
simqi, pr level(90)
setx disap1 0 disap2 0 terrrev 0 regrev 0 polrev 1  lpop_lag (mean) lgdppc_lag (mean) civwar 0 anymid 1
simqi, pr level(90)

simqi, fd(prval(1))  changex(polrev 0 1 anymid 0 1) level(90)


